package com.truba.ohostouchgallery.TouchView;

import Adapter.AsyncTask;
import ru.truba.touchgrallery.TouchView.UrlTouchImageView;
import com.truba.ohostouchgallery.Init;
import ohos.media.image.PixelMap;
import org.junit.Test;

import static org.junit.Assert.*;

public class UrlTouchImageViewTest {

    private final Init init = new Init();
    private final UrlTouchImageView urlTouchImageView = new UrlTouchImageView(init.mContext);
    private final String url = "https://upfile-drcn.platform.hicloud.com/FileServe…FWEBcYa7-c3XtL85iV28wgyPmkFFoZzM2WxQzlBdES0Qw.jpg";

    @Test
    public void getImageView() {

        urlTouchImageView.getImageView().setAccessibility(1000);
        int num = urlTouchImageView.getImageView().getAccessibility();
        assertEquals(1000, num);
    }

    @Test
    public void setUrl() {
        new ImageLoadTask().execute(url);
    }

    public class ImageLoadTask extends AsyncTask<String, Integer, PixelMap> {

        @Override
        protected PixelMap doInBackground(String... strings) {
            assertEquals(url, strings[0]);
            return null;
        }
    }
}